home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr31
/
uncomp12.zip
/
UNCOMP.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-06
|
3KB
|
101 lines
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
void warning(void);
void ooops(void);
void goodbye(void);
void unpak(char ext[3],char flname[255]);
void main(void)
{
char inname[255],e[2];
int sl;
clrscr();
printf("The Uncompresser v1.2, by me, the one, the only, the greatest,\n");
printf("the fabulous, the stupendous, SNAPPLE DRINKER!!!\n\n");
printf("If you have any trouble, call CompuData, 609-232-1245, and go\n");
printf("into chat mode, chances are I'm there.\n\n");
warning();
printf("What is the filename that you wish to unzip? Include the\n");
printf("extension and path, \"EX: \\GAMES\\MYGAME.ZIP\", .ZIP is the\n");
printf("extension and \\GAMES is the path. Press CTRL-C to exit\n\n");
ooops();
scanf("%s",inname);
sl=strlen(inname);
e[0]=toupper(inname[sl-3]);
e[1]=toupper(inname[sl-2]);
e[2]=toupper(inname[sl-1]);
if (!strcmp(e,"ZIP") || !strcmp(e,"ARJ") || !strcmp(e,"LZH"))
unpak(e,inname);
printf("\n\nSorry, it must be either .ZIP, .ARJ, or .LZH\n\n");
return;
}
void unpak(char ext[3],char flname[255])
{
char where[255],doscommand[255];
printf("\n\n");
printf("Where do you want your file to go? EX: \"\\GAMES\", if you are\n");
printf("a beginner, make sure you put the \\ first.\n\n");
scanf("%s",where);
strcpy(doscommand,"MD");
strcat(doscommand,where);
system(doscommand);
strcpy(doscommand,"CD");
strcat(doscommand,where);
system(doscommand);
if (!strcmp(ext,"ZIP")) {
strcpy(doscommand,"PKUNZIP ");
strcat(doscommand,flname);
system(doscommand);
goodbye();
}
if (!strcmp(ext,"ARJ")) {
strcpy(doscommand,"ARJ X ");
strcat(doscommand,flname);
system(doscommand);
goodbye();
}
strcpy(doscommand,"LHA X ");
strcat(doscommand,flname);
system(doscommand);
goodbye();
}
void goodbye(void)
{
printf("\n\n\nWell, if you didn't get any errors, then you are set to\n");
printf("go. Make sure you read or print the instructions for the file\n");
printf("that you downloaded before using it.\n\n");
exit(0);
}
void warning(void)
{
printf("Before you procede, copy the 3 files, LHA.EXE, ARJ.EXE, and\n");
printf("PKUNZIP.EXE to you DOS directory, EX: \"COPY LHA.EXE \\DOS\".\n");
printf("Also, for beginners, put this in the DOS directory OR the same\n");
printf("as the file you are trying to un-compress.\n\n\n");
return;
}
void ooops(void)
{
printf("This time I -KNOW- I got all the bugs out :)\n\n");
return;
}